package cn.tedu._05mvcboot03.common.response;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class JsonResult {
    @ApiModelProperty(value = "状态码",required = true)
    private Integer code;
    @ApiModelProperty(value = "含义",required = true)
    private String msg;
    @ApiModelProperty(value = "数据",required = true)
    private Object data;

    public JsonResult(StatusCode statusCode){
        this.code=statusCode.getCode();
        this.msg=statusCode.getMsg();
    }

    public JsonResult(StatusCode statusCode,Object data){
        this.code=statusCode.getCode();
        this.msg=statusCode.getMsg();
        this.data=data;
    }
}
